import dao.StudentDao;
import data.Student;
import service.DbConnect;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {
    public static void main(String[] args) throws Exception {
        DbConnect<Student> d=new DbConnect();
        System.out.println(d.selectOne("", new Student()));
        System.out.println(getClasses(StudentDao.class));
    }

    public static List getClasses(Class c) throws Exception{
        System.out.println(c.getPackage().getName());
        File f=new File(c.getResource("").getFile());
        List<Class> clas=new ArrayList<>();
        for (File file : f.listFiles()) {
            clas.add(Class.forName(c.getPackage().getName()+"."+file.getName().substring(0,file.getName().indexOf(".class"))));
        }
        return clas;
    }
}